home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-08-22 | 1.6 KB | 38 lines | [TEXT/GEOL] |
- Item 2938085 10-Aug-89 15:28
-
- From: D1220 Vari-Lite, Andy Meldrum,PRT
-
- To: MACAPP.TECH$ MACAPP Tech
-
- Sub: RespondsTo:
-
- I want, I want #99 in a series !!
-
- Smalltalk has a 'RespondsTo' method of TObject that allows objects to be
- interrogated for the presence or otherwise of a particular method.
-
- At this exact instant in time ( like right now ) I have a variety of
- objects with screen representations (sets, pipes, targets, automatedlights) and
- can have any combination of objects selected at any instant. There is no user
- restriction on sending commands that don't make sense to objects. The problem
- is that I must put all the potential methods that ALL of these objects could
- possibly receive into each object to save compiler errors. i.e a setpiece must
- have a MakeSetIntensityCmd method that does nothing at all ( since a setpiece
- has no intensity ) as I will blindly enumerate the selected Objects. I could do
- MemberOf testing, however this is an example of the kind of thing that one is
- not supposed to do ( MPW 2.0.2 Reference, 12-10 ).
-
- I would like to query the objects, as I enumerate them, with a
- 'RespondsTo:MakeSetIntensityCmd' message, say. Clearly I'd have to Typecast the
- Object before making the SetAbsColor call on an object that did have that
- method ( does Smalltalk take care of this too ??? ) but it would be better than
- nothing.
-
- Once again, I'd be real interested in a piece of code that could do this.
- On the other hand I may have missed something blindingly obvious that would
- work just as well. This would not be the first time !!
-
- Andy.
-
-
-